export const flat = (arr = []) => {
	if (!Array.isArray(arr)) {
		return [arr]
	}
	return arr.reduce((ret, item) => {
		if (Array.isArray(item)) {
			return ret.concat(item)
		}
		ret.push(item)
		return ret
	}, [])
}

export const random = (limit = 1) => {
	return Math.round(Math.random() * limit)
}